home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_qt.idb / usr / freeware / include / Qt / qpushbutton.h.z / qpushbutton.h
Encoding:
C/C++ Source or Header  |  1998-10-28  |  2.2 KB  |  85 lines

  1. /****************************************************************************
  2. ** $Id: qpushbutton.h,v 2.9 1998/07/03 00:09:52 hanord Exp $
  3. **
  4. ** Definition of QPushButton class
  5. **
  6. ** Created : 940221
  7. **
  8. ** Copyright (C) 1992-1998 Troll Tech AS.  All rights reserved.
  9. **
  10. ** This file is part of Qt Free Edition, version 1.40.
  11. **
  12. ** See the file LICENSE included in the distribution for the usage
  13. ** and distribution terms, or http://www.troll.no/free-license.html.
  14. **
  15. ** IMPORTANT NOTE: You may NOT copy this file or any part of it into
  16. ** your own programs or libraries.
  17. **
  18. ** Please see http://www.troll.no/pricing.html for information about 
  19. ** Qt Professional Edition, which is this same library but with a
  20. ** license which allows creation of commercial/proprietary software.
  21. **
  22. *****************************************************************************/
  23.  
  24. #ifndef QPUSHBUTTON_H
  25. #define QPUSHBUTTON_H
  26.  
  27. #ifndef QT_H
  28. #include "qbutton.h"
  29. #endif // QT_H
  30.  
  31.  
  32. class QPushButton : public QButton
  33. {
  34. friend class QDialog;
  35.     Q_OBJECT
  36. public:
  37.     QPushButton( QWidget *parent=0, const char *name=0 );
  38.     QPushButton( const char *text, QWidget *parent=0, const char *name=0 );
  39.  
  40.     void    setToggleButton( bool );
  41.  
  42.     bool    autoDefault()    const    { return autoDefButton; }
  43.     void    setAutoDefault( bool autoDef );
  44.     bool    isDefault()    const    { return defButton; }
  45.     void    setDefault( bool def );
  46.  
  47.     void    setIsMenuButton( bool );
  48.     bool    isMenuButton() const;
  49.     
  50.     QSize    sizeHint() const;
  51.  
  52.     void    move( int x, int y );
  53.     void    move( const QPoint &p );
  54.     void    resize( int w, int h );
  55.     void    resize( const QSize & );
  56.     void    setGeometry( int x, int y, int w, int h );
  57.     void    setGeometry( const QRect & );
  58.  
  59. public slots:
  60.     void    setOn( bool );
  61.     void    toggle();
  62.  
  63. protected:
  64.     void    drawButton( QPainter * );
  65.     void    drawButtonLabel( QPainter * );
  66.     void    focusInEvent( QFocusEvent * );
  67.  
  68. private:
  69.     void    init();
  70.  
  71.     uint    autoDefButton    : 1;
  72.     uint    defButton    : 1;
  73.     uint    lastDown    : 1;
  74.     uint    lastDef        : 1;
  75.     uint    lastEnabled    : 1;
  76.     uint    hasMenuArrow    : 1;
  77.  
  78. private:    // Disabled copy constructor and operator=
  79.     QPushButton( const QPushButton & );
  80.     QPushButton &operator=( const QPushButton & );
  81. };
  82.  
  83.  
  84. #endif // QPUSHBUTTON_H
  85.